import Home from "../pages/Home";
import Login from "../pages/Login";
import Register from "../pages/Register";
import Search from "../pages/Search";
import Detail from "../pages/Detail";
import AddCartSuccess from '../pages/AddCartSuccess'
import ShopCart from '../pages/ShopCart'
import Trade from '../pages/Trade'
import Pay from '../pages/Pay'
import PaySuccess from '../pages/PaySuccess'
import Center from '../pages/Center'
const routes = [
  {
    name:'home',
    path: "/home",
    component: () => import('../pages/Home'),
    meta: {
      isShowNav:true
    }
  },
  {
    name:'login',
    path: "/login",
    component: () => import('../pages/Login'),
    meta:{
      isHiddenFooter:true
    }
  },
  {
    name:'register',
    path: "/register",
    component: () => import('../pages/Register'),
    meta:{
      isHiddenFooter:true
    }
  },
  {
    name:'search',
    path: "/search/:keyword?",
    component: () => import('../pages/Search'),
  },
  {
    path: "/",
    redirect: "/home",
  },
  {
    name:'detail',
    path:'/detail/:id',
    component:() => import('../pages/Detail'),
    props:true
  },
  {
    name:"addCartSuccess",
    path:'/addCartSuccess',
    component:() => import('../pages/AddCartSuccess')
  },
  {
    name:'shopCart',
    path:'/shopCart',
    component:() => import('../pages/ShopCart')
  },
  
  {
    // 结算中心 在这个里面有收货的地址和购买的商品
    name: 'trade',
    path: '/trade',
    component:() => import('../pages/Trade') 
  },
  {
    // 付款界面 支付媒介 
    name: 'pay',
    path: '/pay',
    component:() => import('../pages/Pay')
  },
  { 
    // 支持成功的界面
    name: 'paysuccess',
    path: '/paySuccess',
    component:() => import('../pages/PaySuccess')
  },
  {
    // 最后支付完成之后查看的之前的购物清单
    name: 'center',
    path: '/center',
    component:() => import('../pages/Center')
  },
];
export default routes
